/** RunLog-light
 * Log your runs - A simple program for runners
 *  
 * @author M. Mueller
 * @version 15.01.10  
 */

package runlog;

import java.util.ArrayList;
import java.util.List;

/**
 *	Saves Athletes.
 */
public class CAthlete {
	
	/**
	 * The athlete's name.
	 */
	private String name;
	/**
	 * The athlete's birthday.
	 */
	private String birthdate;
	/**
	 * This list saves athlete's training data temporary.
	 */
	private List<CTraining> trainingslist;

	//private int birthday;
	//private int birthmonth;
	//private int birthyear;
	/**
	 * Constructor specifying athlete.
	 * @param name1 Athlete's name
	 * @param birthdate1 Athlete's birthday
	 */
	public CAthlete(final String name1, final String birthdate1) {
		this.setName(name1);
		this.setBirthdate(birthdate1);
		this.setTrainingslist(new ArrayList<CTraining>());
		/*
		this.name = name1;
		this.birthdate = birthdate1;
		this.trainingslist = new ArrayList<CTraining>();
		*/
	}
	/**
	 * @param trainingslist1 The List with training data to set
	 */
	public final void setTrainingslist(final List<CTraining> trainingslist1) {
		assert trainingslist1 != null;
		this.trainingslist = trainingslist1;
	}
	/**
	 * @return The List with training data
	 */
	public final List<CTraining> getTrainingslist() {
		assert this.trainingslist != null;
		return this.trainingslist;
	}
	/**
	 * @return Athlete's name.
	 */
	public final String getName() {
		assert this.name != null;
		return this.name;
	}
	/**
	 * @param name1 Athlete's name to set.
	 */
	public final void setName(final String name1) {
		assert name1 != "_";
		this.name = name1;
	}
	/**
	 * @return Athlete's birthdate.
	 */	
	public final String getBirthdate() {
		assert this.birthdate != null;
		return this.birthdate;
		/*return Integer.toString(this.birthday)
		 *  + Integer.toString(this.birthmonth)
				+ Integer.toString(this.birthyear);*/
	}
	/**
	 * @param birthdate1 Athlete's birthday to set.
	 */
	public final void setBirthdate(final String birthdate1) {
		assert birthdate1 != "_";
		this.birthdate = birthdate1;
		//assert birthdate1.length() == 8;
	}
	/*public void setBirthdate(int day, int month, int year){
		this.birthday = day;
		this.birthmonth = month;
		this.birthyear = year;
	}*/
}
